CpclCommand Class Reference
| Inherits from | Command : NSObject |
|---|---|
| Declared in | CpclCommand.h CpclCommand.m |
– addInitializePrinterOffset:horizontalDpi:verticalDpi:height:qty:
标签初始化(Tag initialization)
- (void)addInitializePrinterOffset:(int)offset horizontalDpi:(int)horizontalDpi verticalDpi:(int)verticalDpi height:(int)height qty:(int)qtyParameters
offset |
标签横向偏移量 (Label lateral offset) |
|---|---|
horizontalDpi |
横向DPI (Transverse DPI) |
verticalDpi |
纵向DPI (Vertical DPI) |
height |
标签最大高度 (Maximum label height) |
qty |
打印的数量 (Number of Prints) |
Discussion
标签初始化(Tag initialization)
Declared In
CpclCommand.h
– addPrint
执行打印(Perform print)
- (void)addPrintDiscussion
执行打印(Perform print)
Declared In
CpclCommand.h
– addPOPrint
执行反向打印(Perform reverse printing)
- (void)addPOPrintDiscussion
执行反向打印(Perform reverse printing)
Declared In
CpclCommand.h
– addTextAngle:withFont:size:x:y:content:
打印文本(Print text)
- (void)addTextAngle:(TextAngle)angle withFont:(int)font size:(int)size x:(int)x y:(int)y content:(NSString *)contentParameters
angle |
文本旋转角度(Text rotation Angle) |
|---|---|
font |
文本字体(The text font) |
size |
字体大小(Size) |
x |
文本横向起始位置(The horizontal starting position of the text) |
y |
文本纵向起始位置(Vertical starting position of the text) |
content |
需要打印的内容(What needs to be printed) |
Discussion
打印文本(Print text)
Declared In
CpclCommand.h
– addQRCodeVertical:x:y:m:u:
初始化二维码参数(Initialize QR code parameters)
- (void)addQRCodeVertical:(Orientation)orientation x:(int)x y:(int)y m:(int)m u:(int)uParameters
orientation |
打印方向(The print direction) |
|---|---|
x |
横向起始位置(Lateral starting position) |
y |
纵向起始位置(Longitudinal starting position) |
m |
QR Code 规范编号,1 或 2,推荐为 2(QR Code specification number,1 or 2, recommended as 2) |
u |
模块的单位宽度/单位高度 1-32,默认为 6(The unit width/unit height of the module is 1-32, default is 6) |
Discussion
初始化二维码参数(Initialize QR code parameters)
Declared In
CpclCommand.h
– addQRCodeLevel:mask:mode:content:
打印二维码(Print QR code)
- (void)addQRCodeLevel:(QRCodeLevel)level mask:(int)mask mode:(Mode)mode content:(NSString *)contentParameters
level |
纠错等级(Error correction level) |
|---|---|
mask |
掩码,掩码有效范围为0-8,mask<0||mask>8省略掩码,交由下位机处理(Mask, mask valid range is 0 to 8, mask < 0 | | mask > 8 omit mask, to the next bit machine processing) |
mode |
输入模式(The input mode) |
content |
二维码内容(QR code content) |
Discussion
打印二维码(Print QR code)
Declared In
CpclCommand.h
– addQRCodeLevel:content:
打印二维码(Print QR code)
- (void)addQRCodeLevel:(QRCodeLevel)level content:(NSString *)contentParameters
level |
纠错等级(Error correction level) |
|---|---|
content |
二维码内容(QR code content) |
Discussion
打印二维码(Print QR code)
Declared In
CpclCommand.h
– endQRCode
结束QR Code指令(End the QR Code instruction)
- (void)endQRCodeDiscussion
结束QR Code指令(End the QR Code instruction)
Declared In
CpclCommand.h
– addConcatText:withY:
文本串联(Text series)
- (void)addConcatText:(int)x withY:(int)yParameters
x |
文本横向起始位置(The horizontal starting position of the text) |
|---|---|
y |
文本纵向起始位置(Vertical starting position of the text) |
Discussion
文本串联(Text series)
Declared In
CpclCommand.h
– addTextFont:size:offset:content:
串联文本内容(Tandem text content)
- (void)addTextFont:(int)font size:(int)size offset:(int)offset content:(NSString *)contentParameters
font |
字体名称/编号(Font name/number) |
|---|---|
size |
字体大小(Size) |
offset |
文本相对起始位置偏置单位值(The unit value of the text is offset relative to the starting position) |
content |
要打印的文本(The text to print) |
Discussion
串联文本内容(Tandem text content)
Declared In
CpclCommand.h
– endConcatText
终止文本串联(Terminate text concatenation)
- (void)endConcatTextDiscussion
终止文本串联(Terminate text concatenation)
Declared In
CpclCommand.h
– addSetmagWidth:height:
放大字体(enlarge font)
- (void)addSetmagWidth:(int)w height:(int)hParameters
w |
宽度放大倍数,有效放大倍数为1~16(Width magnification, effective magnification is 1~16) |
|---|---|
h |
高度放大倍数,有效放大倍数为1~16(High magnification, effective magnification is 1~16) |
Discussion
放大字体(enlarge font)
Declared In
CpclCommand.h
– addSetBlod:
字体加粗(font bold)
- (void)addSetBlod:(BOOL)isBlodParameters
isBlod |
YES:加粗(bold) NO:(Not bold) |
|---|
Discussion
字体加粗(font bold)
Declared In
CpclCommand.h
– addBarcodeOrientation:type:withWidth:ratio:height:x:y:content:
打印条形码(Print Barcode)
- (void)addBarcodeOrientation:(Orientation)orientation type:(BarcodeType)type withWidth:(int)width ratio:(int)ratio height:(int)height x:(int)x y:(int)y content:(NSString *)contentParameters
orientation |
条码方向(Direction of the barcode) |
|---|---|
type |
条码类型(Bar code type) |
width |
窄条的单位宽度(The unit width of a narrow strip) |
ratio |
宽条与窄条的比率(The ratio of wide bars to narrow bars) |
height |
条码单位高度(Bar code unit height) |
x |
条码横向起始位置(Horizontal starting position of barcode) |
y |
条码纵向起始位置(Longitudinal starting position of the barcode) |
content |
条码数据(Barcode data) |
Discussion
打印条形码(Print Barcode)
Declared In
CpclCommand.h
– addPDF417Orientation:x:y:XD:YD:C:S:content:
打印PDF-417条码(Print PDF-417 barcode)
- (void)addPDF417Orientation:(Orientation)orientation x:(int)x y:(int)y XD:(int)XD YD:(int)YD C:(int)C S:(int)S content:(NSString *)contentParameters
orientation |
条码方向(Direction of the barcode) |
|---|---|
x |
条码横向起始位置(Horizontal starting position of barcode) |
y |
条码纵向起始位置(Longitudinal starting position of the barcode) |
XD |
宽度最小点数,值的范围为1-32,默认为2(Width minimum number of points, values range from 1 to 32, default is 2) |
YD |
高度最小点数,值的范围为1-32,默认为6(Height minimum number of points, values range from 1 to 32, default is 6) |
C |
每行容纳的码数,值的范围为1-30,默认为3(The number of yards per line. Values range from 1 to 30. Default is 3) |
S |
纠错等级,值的范围为0-8,默认为1(Error correction level. Values range from 0 to 8. Default is 1) |
content |
PDF-417条码数据(PDF-417 barcode data) |
Discussion
打印PDF-417条码(Print PDF-417 barcode)
Declared In
CpclCommand.h
– addDatamatrixWithX:y:H:content:
DATAMATRIX
- (void)addDatamatrixWithX:(int)x y:(int)y H:(int)H content:(NSString *)contentParameters
x |
条码横向起始位置(Horizontal starting position of barcode) |
|---|---|
y |
条码纵向起始位置(Longitudinal starting position of the barcode) |
H |
条码点密度,值的范围是0-标签范围,一般设置为3-8(Bar code point density, the value range is 0- label range, generally set to 3-8) |
content |
条码数据(barcode data) |
Discussion
DATAMATRIX
Declared In
CpclCommand.h
– addBarcodeTextFont:offset:
用于通过创建条码时所用的相同数据来标记条码,避免了使用单独文本命令注释条码的必要。文本位于条码下方的中间位置 Used to mark a bar code with the same data that was used when it was created, eliminating the need to annotate the bar code with a separate text command. The text is in the middle below the bar code
- (void)addBarcodeTextFont:(int)font offset:(int)offsetParameters
font |
注释条码时要使用的字体号 (The font number to use when commenting the barcode) |
|---|---|
offset |
文本距离条码的单位偏移量 (The unit offset of the text distance bar code) |
Discussion
用于通过创建条码时所用的相同数据来标记条码,避免了使用单独文本命令注释条码的必要。文本位于条码下方的中间位置 Used to mark a bar code with the same data that was used when it was created, eliminating the need to annotate the bar code with a separate text command. The text is in the middle below the bar code
Declared In
CpclCommand.h
– addBarcodeTextOff
禁用BARCODE-TEXT命令效果 (Disable the barcode-text command effect)
- (void)addBarcodeTextOffDiscussion
禁用BARCODE-TEXT命令效果 (Disable the barcode-text command effect)
Declared In
CpclCommand.h
– addBoxX0:y0:x1:y1:width:
打印矩形(Print rectangular)
- (void)addBoxX0:(int)x0 y0:(int)y0 x1:(int)x1 y1:(int)y1 width:(int)widthParameters
x0 |
左上角的 X 坐标(The top left x-coordinate) |
|---|---|
y0 |
左上角的 Y 坐标(The top left y-coordinate) |
x1 |
右下角的 X 坐标(The lower right x-coordinate) |
y1 |
右下角的 Y 坐标(The lower right y-coordinate) |
width |
形成矩形框线条的单位宽度(The unit width of a line that forms a rectangle) |
Discussion
打印矩形(Print rectangular)
Declared In
CpclCommand.h
– addLineX0:y0:x1:y1:width:
打印线条(Print lines)
- (void)addLineX0:(int)x0 y0:(int)y0 x1:(int)x1 y1:(int)y1 width:(int)widthParameters
x0 |
起始点的 X 坐标(The x-coordinate of the starting point) |
|---|---|
y0 |
起始点的 Y 坐标(The y-coordinate of the starting point) |
x1 |
终止点的 X 坐标(The x-coordinate of the termination point) |
y1 |
终止点的 Y 坐标(The y-coordinate of the termination point) |
width |
线条的单位宽度(The unit width of a line) |
Discussion
打印线条(Print lines)
Declared In
CpclCommand.h
– addInverseLineX0:y0:x1:y1:height:
INVERSE-LINE 命令的语法与 LINE 命令相同。位于 INVERSE-LINE 命令所定义 区域内的以前创建的对象的黑色区域将重绘为白色,白色区域将重绘为黑色。这 些对象可以包括文本、条码和/或图形。INVERSE-LINE 对在其之后创建的对象不 起作用,即使这些对象位于该命令的覆盖区域内也是如此 The inverse-line command has the same syntax as the LINE command. The black areas of previously created objects that are within the areas defined by the inverse-line command are redrawn as white, and the white areas are redrawn as black. These objects can include text, bar codes, and/or graphics. Inverse-line does not work on objects created after it, even if they are in the overlay area of the command
- (void)addInverseLineX0:(int)x0 y0:(int)y0 x1:(int)x1 y1:(int)y1 height:(int)heightParameters
x0 |
起始点的 X 坐标(The x-coordinate of the starting point) |
|---|---|
y0 |
起始点的 Y 坐标(The y-coordinate of the starting point) |
x1 |
终止点的 X 坐标(The x-coordinate of the termination point) |
y1 |
终止点的 Y 坐标(The y-coordinate of the termination point) |
height |
反色区域高度(Height of the color inversion area) |
Discussion
INVERSE-LINE 命令的语法与 LINE 命令相同。位于 INVERSE-LINE 命令所定义 区域内的以前创建的对象的黑色区域将重绘为白色,白色区域将重绘为黑色。这 些对象可以包括文本、条码和/或图形。INVERSE-LINE 对在其之后创建的对象不 起作用,即使这些对象位于该命令的覆盖区域内也是如此 The inverse-line command has the same syntax as the LINE command. The black areas of previously created objects that are within the areas defined by the inverse-line command are redrawn as white, and the white areas are redrawn as black. These objects can include text, bar codes, and/or graphics. Inverse-line does not work on objects created after it, even if they are in the overlay area of the command
Declared In
CpclCommand.h
– addImageGraphics:width:x:y:image:withThreshold:
图形命令打印位映射图形(The graphics command prints the bitmap graph)
- (void)addImageGraphics:(Graphics)graphics width:(int)width x:(int)x y:(int)y image:(UIImage *)image withThreshold:(int)thresholdParameters
graphics |
图形打印模式(Graphic printing mode) |
|---|---|
width |
图形的宽度(Width of the figure) |
x |
横向起始位置(Lateral starting position) |
y |
纵向起始位置(Longitudinal starting position) |
image |
图片(Image) |
threshold |
二值化阈值 0:自动 1-255:手动(Binarization threshold 0: automatic 1-255: manual) |
Discussion
图形命令打印位映射图形(The graphics command prints the bitmap graph)
Declared In
CpclCommand.h
– addJustification:end:
使用对齐命令可以控制字段的对齐方式(Use the alignment command to control the alignment of fields)
- (void)addJustification:(Alignment)alignment end:(int)endParameters
alignment |
对齐方式(alignment) |
|---|---|
end |
对齐的结束点。如果未输入参数,则对于横向打 印,对齐命令将使用打印头的宽度;而对于纵向 打印,对齐命令将使用零(页头) End point of alignment. If no arguments are entered, the alignment command uses the width of the print head for landscape printing; For portrait printing, the alignment command will use zero (header) |
Discussion
使用对齐命令可以控制字段的对齐方式(Use the alignment command to control the alignment of fields)
Declared In
CpclCommand.h
– addJustification:
字段的对齐方式(Field alignment)
- (void)addJustification:(Alignment)alignmentParameters
alignment |
对齐方式(alignment) |
|---|
Discussion
字段的对齐方式(Field alignment)
Declared In
CpclCommand.h
– addPageWidth:
打印机假定页面宽度为打印机的完整宽度(The printer assumes that the page width is the full width of the printer)
- (void)addPageWidth:(int)widthParameters
width |
页面的单位宽度(The unit width of the page) |
|---|
Discussion
打印机假定页面宽度为打印机的完整宽度(The printer assumes that the page width is the full width of the printer)
Declared In
CpclCommand.h
– addSpeed:
设置打印速度(Set print speed)
- (void)addSpeed:(int)levelParameters
level |
速度级别(Speed level) |
|---|
Discussion
设置打印速度(Set print speed)
Declared In
CpclCommand.h
– addBeep:
设置蜂鸣器(Set the buzzer)
- (void)addBeep:(int)timeParameters
time |
蜂鸣持续时间,以 1/8 秒为单位递增(The duration of buzzing is increased by 1/8 of a second) |
|---|
Discussion
设置蜂鸣器(Set the buzzer)
Declared In
CpclCommand.h
– queryPrinterStatus
查询打印机状态(Query printer status)
- (void)queryPrinterStatusDiscussion
查询打印机状态(Query printer status)
Declared In
CpclCommand.h